public class Test4 {
    //1.利用while循环求九阶乘及阶乘之和
    public static void main1(String[] args) {
        int j=1;
        int num=0;
        while (j<=5){
            int i=1;
            int ret=1;
            while (i<=j){
                ret*=i;
                i++;
            }
            j++;
           num+=ret;
        }
        System.out.println(num);
    }

    public static void main2(String[] args) {
        int j=1;
        int num=0;
        while (j<=9){
        int i=1;
        int ret=1;
        while (i<=j){
            ret*=i;
            i++;
        }
        j++;
        num+=ret;
        }
        System.out.println(num);
    }
//2break continue区别
    public static void main4(String[] args) {
        int i=1;
        while (i<=100){
            if (i==23){
                i++;
continue;
            }
            System.out.println(i);
            i++;
        }
    }
    public static void main(String[] args) {
        int i=1;
        while (i<=100){
            if (i==23){
                i++;
                break;
            }
            System.out.println(i);
            i++;
        }
    }

    public static void main6(String[] args) {
        int i=1;
        while (i<=100){
            if(i%3==0&&i%5==0){
                System.out.println(i);
            }
            i++;
        }
    }
//3.for循环
    public static void main7(String[] args) {
        for (int i = 0; i <10 ; i++) {
            System.out.println(i);
        }
    }
}
